<?php

/**
 * Returns array of question type chars with attributes
 *
 * @param mixed $returnByName If set to true the array will be by attribute name
 */
function questionAttributes($returnByName=false)
{
	$qattributes=array();
	//For each question attribute include a key:
	// name - the display name
	// types - a string with one character representing each question typy to which the attribute applies
	// help - a short explanation

	// If you insert a new attribute please do it in correct alphabetical order!

	$qattributes["alphasort"]=array(
    "types"=>"!LOWZ",                                   
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get("Sort answers alphabetically"),
    "caption"=>BAOGG_LANGUAGE::get('Sort answers alphabetically'));

	$qattributes["answer_width"]=array(
    "types"=>"ABCEF1:;",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'integer',
    'min'=>'1',
    'max'=>'100',
    "help"=>BAOGG_LANGUAGE::get('Set the percentage width of the answer column (1-100)'),
    "caption"=>BAOGG_LANGUAGE::get('Answer width'));

	$qattributes["array_filter"]=array(
    "types"=>"1ABCEF:;MPLT",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get("Enter the code of a Multiple options question to only show the matching answer options in this question."),
    "caption"=>BAOGG_LANGUAGE::get('Array filter'));

	$qattributes["array_filter_exclude"]=array(
    "types"=>"1ABCEF:;MPLT",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get("Enter the code of a Multiple options question to exclude the matching answer options in this question."),
    "caption"=>BAOGG_LANGUAGE::get('Array filter exclusion'));


	$qattributes["assessment_value"]=array(
    "types"=>"MP",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'default'=>'1',
    'inputtype'=>'integer',
    "help"=>BAOGG_LANGUAGE::get("If one of the subquestions is marked then for each marked subquestion this value is added as assessment."),
    "caption"=>BAOGG_LANGUAGE::get('Assessment value'));    

	$qattributes["category_separator"]=array(
    "types"=>"!",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Category Separator'),
    "caption"=>BAOGG_LANGUAGE::get('Category Separator'));

	$qattributes["code_filter"]=array(
    "types"=>"WZ",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Filter the available answers by this value'),
    "caption"=>BAOGG_LANGUAGE::get('Code filter'));

	$qattributes["display_columns"]=array(
    "types"=>"GLMZ",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'integer',
    'default'=>'1',
    'min'=>'1',
    'max'=>'100',
    "help"=>BAOGG_LANGUAGE::get('The answer options will be distributed across the number of columns set here'),
    "caption"=>BAOGG_LANGUAGE::get('Display columns'));

	$qattributes["display_rows"]=array(
    "types"=>"QSTU",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('How many rows to display'),
    "caption"=>BAOGG_LANGUAGE::get('Display rows'));

	$qattributes["dropdown_dates"]=array(
    "types"=>"D",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,   
    "help"=>BAOGG_LANGUAGE::get('Use accessible select boxes instead of calendar popup'),
    "caption"=>BAOGG_LANGUAGE::get('Display select boxes'));

	$qattributes["dropdown_dates_year_min"]=array(
    "types"=>"D",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',      
    "help"=>BAOGG_LANGUAGE::get('Minimum year value in calendar'),
    "caption"=>BAOGG_LANGUAGE::get('Minimum year'));

	$qattributes["dropdown_dates_year_max"]=array(
    "types"=>"D",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',      
    "help"=>BAOGG_LANGUAGE::get('Maximum year value for calendar'),
    "caption"=>BAOGG_LANGUAGE::get('Maximum year'));

	$qattributes["dropdown_prepostfix"]=array(
    "types"=>"1",
    'category'=>BAOGG_LANGUAGE::get('Other'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Prefix|Suffix for dropdown lists'),
    "caption"=>BAOGG_LANGUAGE::get('Prefix|Suffix'));

	$qattributes["dropdown_separators"]=array(
    "types"=>"1",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>120,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Post-Answer-Separator|Inter-Dropdownlist-Separator for dropdown lists'),
    "caption"=>BAOGG_LANGUAGE::get('Dropdown separators'));

	$qattributes["dualscale_headerA"]=array(
    "types"=>"1",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>110,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Enter a header text for scale A'),
    "caption"=>BAOGG_LANGUAGE::get('Header scale A'));

	$qattributes["dualscale_headerB"]=array(
    "types"=>"1",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>111,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Enter a header text for scale B'),
    "caption"=>BAOGG_LANGUAGE::get('Header scale B'));

	$qattributes["equals_num_value"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Input'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Multiple numeric inputs sum must equal this value'),
    "caption"=>BAOGG_LANGUAGE::get('Equals sum value'));

	$qattributes["exclude_all_others"]=array(
    "types"=>"M",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Excludes all other options if a certain answer is selected - just enter the answer code(s) seperated with a semikolon.'),
    "caption"=>BAOGG_LANGUAGE::get('Exclusive option'));

	$qattributes["hide_tip"]=array(
    "types"=>"!KLMNOPRWZ",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get('Hide the tip that is normally shown with a question'),
    "caption"=>BAOGG_LANGUAGE::get('Hide tip'));

	$qattributes['hidden']=array(
    'types'=>'15ABCDEFGHIKLMNOPQRSTUWXYZ!:;',
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>101,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,    
    'help'=>BAOGG_LANGUAGE::get('Hide this question at any time. This is useful for including data using answer prefilling.'),
    'caption'=>BAOGG_LANGUAGE::get('Always hide this question'));

	$qattributes["max_answers"]=array(
    "types"=>"MPR",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>11,
    'inputtype'=>'integer',
    "help"=>BAOGG_LANGUAGE::get('Limit the number of possible answers'),
    "caption"=>BAOGG_LANGUAGE::get('Maximum answers'));

	$qattributes["max_num_value"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Input'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Maximum sum value of multiple numeric input'),
    "caption"=>BAOGG_LANGUAGE::get('Maximum sum value'));

	$qattributes["max_num_value_sgqa"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Enter the SGQA identifier to use the total of a previous question as the maximum for this question'),
    "caption"=>BAOGG_LANGUAGE::get('Max value from SGQA'));

	$qattributes["maximum_chars"]=array(
    "types"=>"STUNQK",
    'category'=>BAOGG_LANGUAGE::get('Input'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Maximum characters allowed'),
    "caption"=>BAOGG_LANGUAGE::get('Maximum characters'));

	$qattributes["min_answers"]=array(
    "types"=>"MPR",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>10,
    'inputtype'=>'integer',
    "help"=>BAOGG_LANGUAGE::get('Ensure a minimum number of possible answers (0=No limit)'),
    "caption"=>BAOGG_LANGUAGE::get('Minimum answers'));

	$qattributes["min_num_value"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Input'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Multiple numeric inputs must be greater than this value'),
    "caption"=>BAOGG_LANGUAGE::get('Minimum sum value'));

	$qattributes["min_num_value_sgqa"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
     'sortorder'=>100,
   'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Enter the SGQA identifier to use the total of a previous question as the minimum for this question'),
    "caption"=>BAOGG_LANGUAGE::get('Min value from SGQA'));

	$qattributes["multiflexible_max"]=array(
    "types"=>":",
    'category'=>BAOGG_LANGUAGE::get('Display'),
     'sortorder'=>100,
   'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Maximum value for array(mult-flexible) question type'),
    "caption"=>BAOGG_LANGUAGE::get('Maximum value'));

	$qattributes["multiflexible_min"]=array(
    "types"=>":",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Minimum value for array(multi-flexible) question type'),
    "caption"=>BAOGG_LANGUAGE::get('Minimum value'));

	$qattributes["multiflexible_step"]=array(
    "types"=>":",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Step value'),
    "caption"=>BAOGG_LANGUAGE::get('Step value'));

	$qattributes["multiflexible_checkbox"]=array(
    "types"=>":",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('Use checkbox layout'),
    "caption"=>BAOGG_LANGUAGE::get('Checkbox layout'));

	$qattributes["num_value_equals_sgqa"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('SGQA identifier to use total of previous question as total for this question'),
    "caption"=>BAOGG_LANGUAGE::get('Value equals SGQA'));

	$qattributes["numbers_only"]=array(
    "types"=>"Q;S",
    'category'=>BAOGG_LANGUAGE::get('Other'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get('Allow only numerical input'),
    "caption"=>BAOGG_LANGUAGE::get('Numbers only'));

	$qattributes["input_boxes"]=array(
	"types"=>":",
	'category'=>BAOGG_LANGUAGE::get('Display'),
	'sortorder'=>100,
	'inputtype'=>'singleselect',
	'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
	'default'=>0,
	"help"=>BAOGG_LANGUAGE::get("Present as text input boxes instead of dropdown lists"),
	"caption"=>BAOGG_LANGUAGE::get("Text inputs"));

	$qattributes["other_comment_mandatory"]=array(
    "types"=>"PLW!Z",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get("Make the 'Other:' comment field mandatory when the 'Other:' option is active"),
    "caption"=>BAOGG_LANGUAGE::get("'Other:' comment mandatory"));

	$qattributes["other_numbers_only"]=array(
    "types"=>"LMP",
    'category'=>BAOGG_LANGUAGE::get('Logic'),
     'sortorder'=>100,
   'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get("Allow only numerical input for 'Other' text"),
    "caption"=>BAOGG_LANGUAGE::get("Numbers only for 'Other'"));

	$qattributes["other_replace_text"]=array(
    "types"=>"LMPWZ!",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get("Replaces the label of the 'Other:' answer option with a custom text"),
    "caption"=>BAOGG_LANGUAGE::get("Label for 'Other:' option"));

	$qattributes["page_break"]=array(
    "types"=>"15ABCDEFGHKLMNOPQRSTUWXYZ!:;",
    'category'=>BAOGG_LANGUAGE::get('Other'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('Insert a page break before this question in printable view by setting this to Yes.'),
    "caption"=>BAOGG_LANGUAGE::get('Insert page break in printable view'));

	$qattributes["prefix"]=array(
    "types"=>"KNQS",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>10,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Add a prefix to the answer field'),
    "caption"=>BAOGG_LANGUAGE::get('Answer prefix'));

	$qattributes["public_statistics"]=array(
    "types"=>"15ABCEFGHKLMNOPRWYZ!:",
    'category'=>BAOGG_LANGUAGE::get('Other'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('Show statistics of this question in the public statistics page'),
    "caption"=>BAOGG_LANGUAGE::get('Show in public statistics'));

	$qattributes["random_order"]=array(
    "types"=>"!ABCEFHKLMOPQRWZ1:;",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get('Present answers in random order'),
    "caption"=>BAOGG_LANGUAGE::get('Random answer order'));

	$qattributes["slider_layout"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>1,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,                 
    "help"=>BAOGG_LANGUAGE::get('Use slider layout'),
    "caption"=>BAOGG_LANGUAGE::get('Use slider layout'));

	$qattributes["slider_min"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Slider minimum value'),
    "caption"=>BAOGG_LANGUAGE::get('Slider minimum value'));

	$qattributes["slider_max"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Slider maximum value'),
    "caption"=>BAOGG_LANGUAGE::get('Slider maximum value'));

	$qattributes["slider_accuracy"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Slider accuracy'),
    "caption"=>BAOGG_LANGUAGE::get('Slider accuracy'));

	$qattributes["slider_default"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Slider initial value'),
    "caption"=>BAOGG_LANGUAGE::get('Slider initial value'));

	$qattributes["slider_middlestart"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>10,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('The handle is displayed at the middle of the slider (this will not set the initial value)'),
    "caption"=>BAOGG_LANGUAGE::get('Slider starts at the middle position'));

	$qattributes["slider_showminmax"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('Display min and max value under the slider'),
    "caption"=>BAOGG_LANGUAGE::get('Display slider min and max value'));

	$qattributes["slider_separator"]=array(
    "types"=>"K",
    'category'=>BAOGG_LANGUAGE::get('Slider'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Answer|Left-slider-text|Right-slider-text separator character'),
    "caption"=>BAOGG_LANGUAGE::get('Slider left/right text separator'));

	$qattributes["suffix"]=array(
    "types"=>"KNQS",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>11,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Add a suffix to the answer field'),
    "caption"=>BAOGG_LANGUAGE::get('Answer suffix'));

	$qattributes["text_input_width"]=array(
    "types"=>"KNSTUQ;",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>100,
    'inputtype'=>'text',
    "help"=>BAOGG_LANGUAGE::get('Width of text input box'),
    "caption"=>BAOGG_LANGUAGE::get('Input box width'));

	$qattributes["use_dropdown"]=array(
    "types"=>"1",
    'category'=>BAOGG_LANGUAGE::get('Display'),
    'sortorder'=>112,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get('Use dual dropdown boxes instead of dual scales'),
    "caption"=>BAOGG_LANGUAGE::get('Dual dropdown'));

	$qattributes["scale_export"]=array(
    "types"=>"CEFGHLMOPWYZ1!:",
    'category'=>BAOGG_LANGUAGE::get('Other'),
    'sortorder'=>100,
    'inputtype'=>'singleselect',
    'options'=>array(0=>BAOGG_LANGUAGE::get('Default'),
	1=>BAOGG_LANGUAGE::get('Nominal'),
	2=>BAOGG_LANGUAGE::get('Ordinal'),
	3=>BAOGG_LANGUAGE::get('Scale')),
    'default'=>0,      
    "help"=>BAOGG_LANGUAGE::get("Set a specific SPSS export scale type for this question"),
    "caption"=>BAOGG_LANGUAGE::get('SPSS export scale type'));

	//Timer attributes
	$qattributes["time_limit"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>90,
    "inputtype"=>"integer",
    "help"=>BAOGG_LANGUAGE::get("Limit time to answer question (in seconds)"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit"));

	$qattributes["time_limit_action"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>92,
    'inputtype'=>'singleselect',
    'options'=>array(1=>BAOGG_LANGUAGE::get('Warn and move on'),
	2=>BAOGG_LANGUAGE::get('Move on without warning'),
	3=>BAOGG_LANGUAGE::get('Disable only')),
    "help"=>BAOGG_LANGUAGE::get("Action to perform when time limit is up"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit action"));

	$qattributes["time_limit_disable_next"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>94,
    "inputtype"=>"singleselect",
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
    "help"=>BAOGG_LANGUAGE::get("Disable the next button until time limit expires"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit disable next"));

	$qattributes["time_limit_disable_prev"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>96,
    "inputtype"=>"singleselect",
    'options'=>array(0=>BAOGG_LANGUAGE::get('No'),
	1=>BAOGG_LANGUAGE::get('Yes')),
	"help"=>BAOGG_LANGUAGE::get("Disable the prev button until the time limit expires"),
	"caption"=>BAOGG_LANGUAGE::get("Time limit disable prev"));

	$qattributes["time_limit_countdown_message"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>98,
    "inputtype"=>"textarea",
	"help"=>BAOGG_LANGUAGE::get("The text message that displays in the countdown timer during the countdown"),
	"caption"=>BAOGG_LANGUAGE::get("Time limit countdown message"));

	$qattributes["time_limit_timer_style"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>100,
    "inputtype"=>"textarea",
    "help"=>BAOGG_LANGUAGE::get("CSS Style for the message that displays in the countdown timer during the countdown"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit timer CSS style"));

	$qattributes["time_limit_message_delay"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>102,
    "inputtype"=>"integer",
    "help"=>BAOGG_LANGUAGE::get("Display the 'time limit expiry message' for this many seconds before performing the 'time limit action' (defaults to 1 second if left blank)"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit expiry message display time"));

	$qattributes["time_limit_message"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>104,
    "inputtype"=>"textarea",
    "help"=>BAOGG_LANGUAGE::get("The message to display when the time limit has expired (a default message will display if this setting is left blank)"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit expiry message"));

	$qattributes["time_limit_message_style"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>106,
    "inputtype"=>"textarea",
    "help"=>BAOGG_LANGUAGE::get("CSS style for the 'time limit expiry message'"),
    "caption"=>BAOGG_LANGUAGE::get("Time limit message CSS style"));

	$qattributes["time_limit_warning"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>108,
    "inputtype"=>"integer",
    "help"=>BAOGG_LANGUAGE::get("Display a 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
    "caption"=>BAOGG_LANGUAGE::get("1st Time limit warning message timer"));

	$qattributes["time_limit_warning_display_time"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>110,
    "inputtype"=>"integer",
    "help"=>BAOGG_LANGUAGE::get("The 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
    "caption"=>BAOGG_LANGUAGE::get("1st Time limit warning message display time"));

	$qattributes["time_limit_warning_message"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>112,
    "inputtype"=>"textarea",
    "help"=>BAOGG_LANGUAGE::get("The message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
    "caption"=>BAOGG_LANGUAGE::get("1st Time limit warning message"));

	$qattributes["time_limit_warning_style"]=array(
    "types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>114,
    "inputtype"=>"textarea",
    "help"=>BAOGG_LANGUAGE::get("CSS style used when the 'time limit warning' message is displayed"),
    "caption"=>BAOGG_LANGUAGE::get("1st Time limit warning CSS style"));

	$qattributes["time_limit_warning_2"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>116,
    "inputtype"=>"integer",
	"help"=>BAOGG_LANGUAGE::get("Display the 2nd 'time limit warning' when there are this many seconds remaining in the countdown (warning will not display if left blank)"),
	"caption"=>BAOGG_LANGUAGE::get("2nd Time limit warning message timer"));

	$qattributes["time_limit_warning_2_display_time"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>118,
    "inputtype"=>"integer",
	"help"=>BAOGG_LANGUAGE::get("The 2nd 'time limit warning' will stay visible for this many seconds (will not turn off if this setting is left blank)"),
	"caption"=>BAOGG_LANGUAGE::get("2nd Time limit display time"));

	$qattributes["time_limit_warning_2_message"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>120,
    "inputtype"=>"textarea",
	"help"=>BAOGG_LANGUAGE::get("The 2nd message to display as a 'time limit warning' (a default warning will display if this is left blank)"),
	"caption"=>BAOGG_LANGUAGE::get("2nd Time limit warning message"));

	$qattributes["time_limit_warning_2_style"]=array(
	"types"=>"STUX",
    'category'=>BAOGG_LANGUAGE::get('Timing'),
    'sortorder'=>122,
    "inputtype"=>"textarea",
	"help"=>BAOGG_LANGUAGE::get("CSS style used when the 2nd 'time limit warning' message is displayed"),
	"caption"=>BAOGG_LANGUAGE::get("2nd Time Limit Warning CSS Style"));



	//This builds a more useful array (don't modify)
	if ($returnByName==false)
	{
		foreach($qattributes as $qname=>$qvalue)
		{
			for ($i=0; $i<=strlen($qvalue['types'])-1; $i++)
			{
				$qat[substr($qvalue['types'], $i, 1)][]=array("name"=>$qname,
			"inputtype"=>$qvalue['inputtype'],
			"category"=>$qvalue['category'],
			"sortorder"=>$qvalue['sortorder'],
			"readonly"=>isset($qvalue['readonly_when_active'])?$qvalue['readonly_when_active']:false,
			"options"=>isset($qvalue['options'])?$qvalue['options']:'',
			"default"=>isset($qvalue['default'])?$qvalue['default']:'',
                                                            "help"=>$qvalue['help'],
			"caption"=>$qvalue['caption']);
			}
		}
		return $qat;
	}
	else {
		return $qattributes;
	}
}



/**
 * getqtypelist() Returns list of question types available in Questionnaire. Edit this if you are adding a new
 *    question type
 *
 * @global string $publicurl
 * @global string $sourcefrom
 *
 * @param string $SelectedCode Value of the Question Type (defaults to "T")
 * @param string $ReturnType Type of output from this function (defaults to selector)
 *
 * @return depending on $ReturnType param, returns a straight "array" of question types, or an <option></option> list
 *
 * Explanation of questiontype array:
 *
 * description : Question description
 * subquestions : 0= Does not support subquesitons 1=Supports subquestions
 * answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2)
 */
function getqtypelist()
{
	
	$qtypes = array(
    "1"=>array('description'=>BAOGG_LANGUAGE::get("Array Dual Scale"),
               'subquestions'=>1,
               'assessable'=>1,
               'hasdefaultvalues'=>0,
               'answerscales'=>2),
    "5"=>array('description'=>BAOGG_LANGUAGE::get("5 Point Choice"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "A"=>array('description'=>BAOGG_LANGUAGE::get("Array (5 Point Choice)"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>0),
    "B"=>array('description'=>BAOGG_LANGUAGE::get("Array (10 Point Choice)"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>0),
    "C"=>array('description'=>BAOGG_LANGUAGE::get("Array (Yes/No/Uncertain)"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>0),
    "D"=>array('description'=>BAOGG_LANGUAGE::get("Date"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "E"=>array('description'=>BAOGG_LANGUAGE::get("Array (Increase/Same/Decrease)"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>0),
    "F"=>array('description'=>BAOGG_LANGUAGE::get("Array"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>1),
    "G"=>array('description'=>BAOGG_LANGUAGE::get("Gender"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "H"=>array('description'=>BAOGG_LANGUAGE::get("Array by column"),
               'hasdefaultvalues'=>0,
               'subquestions'=>1,
               'assessable'=>1,
               'answerscales'=>1),
    "I"=>array('description'=>BAOGG_LANGUAGE::get("Language Switch"),
               'hasdefaultvalues'=>0,
               'subquestions'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "K"=>array('description'=>BAOGG_LANGUAGE::get("Multiple Numerical Input"),
               'hasdefaultvalues'=>0,
               'subquestions'=>1,
               'assessable'=>1,
               'answerscales'=>0),
    "L"=>array('description'=>BAOGG_LANGUAGE::get("List (Radio)"),
               'subquestions'=>0,
               'hasdefaultvalues'=>1,
               'assessable'=>1,
               'answerscales'=>1),
    "M"=>array('description'=>BAOGG_LANGUAGE::get("Multiple Options"),
               'subquestions'=>1,
               'hasdefaultvalues'=>1,
               'assessable'=>1,
               'answerscales'=>0),
    "N"=>array('description'=>BAOGG_LANGUAGE::get("Numerical Input"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "O"=>array('description'=>BAOGG_LANGUAGE::get("List with comment"),
               'subquestions'=>0,
               'hasdefaultvalues'=>1,
               'assessable'=>1,
               'answerscales'=>1),
    "P"=>array('description'=>BAOGG_LANGUAGE::get("Multiple Options With Comments"),
               'subquestions'=>1,
               'hasdefaultvalues'=>1,
               'assessable'=>1,
               'answerscales'=>0),
    "Q"=>array('description'=>BAOGG_LANGUAGE::get("Multiple Short Text"),
               'subquestions'=>1,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "R"=>array('description'=>BAOGG_LANGUAGE::get("Ranking"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>1),
    "S"=>array('description'=>BAOGG_LANGUAGE::get("Short Free Text"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "T"=>array('description'=>BAOGG_LANGUAGE::get("Long Free Text"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "U"=>array('description'=>BAOGG_LANGUAGE::get("Huge Free Text"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "X"=>array('description'=>BAOGG_LANGUAGE::get("Boilerplate Question"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "Y"=>array('description'=>BAOGG_LANGUAGE::get("Yes/No"),
               'subquestions'=>0,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
    "!"=>array('description'=>BAOGG_LANGUAGE::get("List (Dropdown)"),
               'subquestions'=>0,
               'hasdefaultvalues'=>1,
               'assessable'=>1,
               'answerscales'=>1),
    ":"=>array('description'=>BAOGG_LANGUAGE::get("Array (Numbers)"),
               'subquestions'=>2,
               'hasdefaultvalues'=>0,
               'assessable'=>1,
               'answerscales'=>0),
    ";"=>array('description'=>BAOGG_LANGUAGE::get("Array (Texts)"),
               'subquestions'=>2,
               'hasdefaultvalues'=>0,
               'assessable'=>0,
               'answerscales'=>0),
	);
	asort($qtypes);	
	return $qtypes;
}